<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center QuestionBank_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub QuestionBank_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  QuestionBank_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<text class='QuestionBank_fd0_0_c1'>随堂考试</text>
				<view class='flex flex-wrap align-center QuestionBank_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="information_view">
			<view class="information_tabs">
				<u-tabs :list="tabsList" :is-scroll="true" font-size="32" inactive-color="#333333" active-color="#0052B5" bar-width="60" name="fenleimingcheng" :current="current" @change="change"></u-tabs>
			</view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#1593FF"></u-loading>
				<view>加载中</view>
			</view>
			<view class="information_list" v-else>
				<template v-for="(item, index) in list">
					<view class="list_item" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/mockExamination/mockExamination?id=${item.aid}&type=${2}`">
						<view class="item_img">
							<u-lazy-load :image="item.image" height="238" border-radius="8" img-mode="aspectFill"></u-lazy-load>
						</view>
						<view class="item_text">
							{{item.test_name}}
						</view>
					</view>
				</template>
			</view>
			<view class="noData" v-if="list.length == 0 && !isShow">
				<image :src='STATIC_URL+"no.png"'></image>
			</view>
		</view>

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				tabsList: [],
				current: 0,
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.getTabs();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			
		},
		// 上拉加载
		onReachBottom() {
			
		},
		onPageScroll(e) {

		},
		methods: {
			getTabs() {
				this.$api.post(global.apiUrls.post65a7c5ede56c4, {
					
				}).then(res => {
					if (res.data.code == 1) {
						this.tabsList = res.data.data;
						this.getList();
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			getList() {
				this.$api.post(global.apiUrls.post6343d947d8c5e, {
					freesuitangceshifenlei_id: this.tabsList[this.current].aid
				}).then(res => {
					this.isShow = false;
					if (res.data.code == 1) {
						this.list = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			change(index) {
				this.current = index;
				this.isShow = true;
				this.getList();
			}
		}
	};
</script>
<style lang="scss" scoped>
	.information_view {
		// padding: 0 32rpx;
		.information_tabs {
			height: 80rpx;
			width: 100%;
			position: fixed;
			z-index: 10;
		}
	
		.information_list {
			padding: 104rpx 32rpx 24rpx;
			overflow: hidden;
			.list_item {
				float: left;
				width: 217rpx;
				height: 313rpx;
				padding: 10rpx 10rpx 16rpx 10rpx;
				margin: 0 16rpx 24rpx 0;
				background: #ffffff;
				border-radius: 8rpx;
				.item_img {
					width: 100%;
					height: 238rpx;
					margin-bottom: 16rpx;
					/deep/.u-lazy-item {
						width: 100%;
						height: 238rpx;
					}
				}
				.item_text {
					font-size: 24rpx;
					font-weight: 500;
					overflow: hidden;
					text-overflow: ellipsis;
					/* 弹性伸缩盒子模型显示 */
					display: -webkit-box;
					-webkit-line-clamp: 1;
					-webkit-box-orient: vertical;
				}
			}
			.list_item:nth-child(3n+3) {
				margin: 0 0 24rpx 0;
			}
		}
	}
	
	.QuestionBank_fd1_0 {
		background: #fff;
		background-size: 100% !important;
		height: 140rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.QuestionBank_fd1_0_c0 {
		width: 88rpx;
		height: 88rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
	}

	.QuestionBank_fd1_0_c1 {
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.QuestionBank_fd1_0_c2 {
		font-size: 26rpx;
		font-weight: 500;
		color: #333;
	}

	.QuestionBank_flex_1 {
		margin: 32rpx 32rpx 0rpx 32rpx;
	}

	.QuestionBank_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.QuestionBank_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
		line-height: 36rpx;
	}

	.QuestionBank_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #ffffff;
		line-height: 50rpx;
	}

	.QuestionBank_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.QuestionBank_flex_0 {
		background: url(https://app.ezsdcsm.com/images/91.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% 100% !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: #f8f8f8;
		background-size: 100% auto !important;
	}
</style>
